package com.yuanfeng.business.controller;


import com.yuanfeng.business.dto.AuditDeliveryDTO;
import com.yuanfeng.business.dto.delivery.QueryIsDeliveryDTO;
import com.yuanfeng.business.dto.delivery.ShopSetDTO;
import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @ClassName ShopCashOnDeliveryController
 * @Description 货到付款
 * @Author cyp
 * @Date 2023-05-26 17:20:34
 * @Version 1.0
 **/
@RestController
@RequestMapping("shop/cashOnDelivery")
public class ShopCashOnDeliveryController extends BaseController  {

    /**
     * 查询店铺是否开通货到付款
     * @param queryIsDeliveryDTO
     * @return
     */
    @PostMapping("/queryIsDelivery")
    public ResponseResult queryIsDelivery(@RequestBody QueryIsDeliveryDTO queryIsDeliveryDTO){

        return  shopCashOnDeliveryService.queryIsDelivery(queryIsDeliveryDTO);
    }

    /**
     * 查询申请开通货到支付页面的店铺配置信息
     * @param queryShopSetDTO
     * @return
     */
    @PostMapping("/queryShopSetDelivery")
    public ResponseResult queryShopSetDelivery(@RequestBody ShopSetDTO queryShopSetDTO){
        return shopCashOnDeliveryService.queryShopSetDelivery(queryShopSetDTO);
    }

    /**
     * 店铺申请开启/关闭货到付款
     * @param applyPayOnDeliveryDTO
     * @return
     */
    @PostMapping("/applyStatusOn")
    public ResponseResult applyPayOnDeliveryOn(@RequestBody ShopSetDTO applyPayOnDeliveryDTO) {
        return shopCashOnDeliveryService.applyPayOnDeliveryOn(applyPayOnDeliveryDTO);
    }

    /**
     * 平台审核货到付款接口
     *
     * @param param
     * @return
     */
    @PostMapping("/auditDelivery")
    public ResponseResult auditDelivery(@RequestBody AuditDeliveryDTO param) {
        return shopCashOnDeliveryService.auditDelivery(param);
    }

    /**
     * 平台查询货到付款申请的店铺列表
     *
     * @param param
     * @return
     */
    @PostMapping("/queryDeliveryShop")
    public ResponseResult queryDeliveryShop(@RequestBody Map<String,Object> param) {
        return shopCashOnDeliveryService.queryDeliveryShop(param);
    }
}
